<template>      
    <div class="talk">
       <button @click="getLoveTalk">获取一句土味情话</button>
       <ul>
        <li v-for="talk in talkStore.talkList" :key="talk.id">{{ talk.title }}</li>
       </ul>
    </div>
</template>

<script lang="ts"  setup name="LoveTalk">  //脚本标签
   import { useTalkStore } from "@/store/lovetalk";

   const talkStore = useTalkStore()

   function getLoveTalk(){
      talkStore.getATalk()
     
    }


</script>

<style scoped>
  .talk {
    background-color: orange;
    padding: 10px;
    border-radius:10px;
    box-shadow: 0 0 10px;
  }
  select,button {
    margin: 0 5px;
    height: 25px;
  }
</style>